// elements that make up a decision tree

public class DecisionTree
{

  public static abstract class Actuator implements Node {
    //returns a direction array
    public abstract Action perform();
    public Actuator makeDecision() {return this;}
  }

  public static abstract class Decision implements Node {
    public Decision(Node yes_branch, Node no_branch) {
      yes_branch_ = yes_branch;
      no_branch_ = no_branch;
    }
    public Actuator makeDecision() {
      if(this.decide())
        return yes_branch_.makeDecision();
      else
        return no_branch_.makeDecision();
    }
    public abstract boolean decide();
    private Node yes_branch_;
    private Node no_branch_;
  }

  public static interface Node {
    Actuator makeDecision();
  }

}
